package shoppingmall.reception.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import shoppingmall.reception.dto.PageBean;
import shoppingmall.reception.mapper.CarouselMapper;
import shoppingmall.reception.pojo.Carousel;
import shoppingmall.reception.service.CarouselService;

import java.util.List;

/**
 * 服务层接口实现类-前台轮播图相关服务
 */
@Service
public class CarouselServiceImpl implements CarouselService {

    @Autowired
    private CarouselMapper carouselMapper;  //carouseMapper实例方法

    @Override
    public PageBean getCarouselData() {
        //调用mapper层方法
        List<Carousel> carouselList = carouselMapper.getCarouselList();
        //返回结果
        return new PageBean(carouselList.size(), carouselList);
    }
}
